import React, { Component } from 'react'
import { connect } from 'react-redux'
import action from './store/actions/kind'
class Kind extends Component {
  componentDidMount () {
    this.props.getKindList()
  }
  render() {
    const { kindList }  = this.props
    return (
      <div>
        分类
        {
          kindList && kindList.map((item, index) => {
            return (
              <div key = { index }>{ item }</div>
            )
          })
        }
      </div>
    )
  }
}

export default connect(
  (state) => {
    return {
      kindList: state.kind.kindList
    }
  },
  (dispatch) => {
    return {
      getKindList () {
        dispatch(action.getKindListAction)
      }
    }
  })(Kind)
